import React from 'react'

import Nav from '../components/Nav'
import TopBar from '../components/TopBar'
import Footer from '../components/Footer'
import LoanList from '../components/LoanList'
import Loginout from '../components/Loginout'

class Myloan extends React.Component{
    constructor(props){
        super(props);
        this.state ={
            dialog:"false"
        }
    }
    componentWillMount(){
        sessionStorage.setItem('lastRouter','/myloan');
    }
    dialogShow(msg){//处理父组件和子组件的通信
        this.setState({
            dialog:msg
        });
    }
    render(){
        return(
            <div className="loan">
                <TopBar/>
                <div className="loan-info">
                    <Nav dialogShow = {msg => this.dialogShow(msg)}/>
                    <LoanList/>
                </div>
                <Footer/>
                <Loginout dialog={this.state.dialog} isDialog = {msg => this.dialogShow(msg)}/>
            </div>
        )
    }
}

export default Myloan